<div class="content-section introduction">
    <div class="feature-intro">
        <h1>Image</h1>
        <p>Displays an image with preview and tranformation options. For multiple image, see <a [routerLink]="['/galleria']">Galleria.</a></p>
    </div>
    <app-demoActions github="button"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <h5>Basic</h5>
        <p-image src="assets/showcase/images/galleria/galleria1.jpg" alt="Image" width="250"></p-image>

        <h5>Preview</h5>
        <p-image src="assets/showcase/images/galleria/galleria11.jpg" alt="Image" width="250" [preview]="true"></p-image>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            <h5>Import</h5>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;ImageModule&#125; from 'primeng/image';
</app-code>

            <h5>Getting Started</h5>
		    <p>Image is used as the native <i>img</i> element and supports all properties that the native element has.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-image src="assets/showcase/images/galleria/galleria1.jpg" alt="Image" width="250"&gt;&lt;/p-image&gt;
</app-code>


            <h5>Preview</h5>
            <p>Preview mode displays a modal layer when the image is clicked that provides transformation options such as rotating and zooming.</p>

            <h5>Indicator Templating</h5>
            <p>An eye icon is displayed by default when the image is hovered in preview mode. Use the <i>indicator</i> template for custom content.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-image src="assets/showcase/images/galleria/galleria1.jpg" alt="Image" width="250"&gt;
    &lt;ng-template pTemplate="indicator"&gt;
        Indicator Content
    &lt;/ng-template&gt;
&lt;/p-image&gt;
</app-code>

            <h5>Properties</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>preview</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Controls the preview functionality.</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>any</td>
                            <td>null</td>
                            <td>Inline style of the element.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the element.</td>
                        </tr>
                        <tr>
                            <td>imageStyle</td>
                            <td>any</td>
                            <td>null</td>
                            <td>Inline style of the image element.</td>
                        </tr>
                        <tr>
                            <td>imageClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the image element.</td>
                        </tr>
                        <tr>
                            <td>src</td>
                            <td>string | SafeUrl</td>
                            <td>null</td>
                            <td>src attribute of the image element.</td>
                        </tr>
                        <tr>
                            <td>alt</td>
                            <td>string</td>
                            <td>null</td>
                            <td>alt attribute of the image element.</td>
                        </tr>
                        <tr>
                            <td>width</td>
                            <td>string</td>
                            <td>null</td>
                            <td>width attribute of the image element.</td>
                        </tr>
                        <tr>
                            <td>height</td>
                            <td>string</td>
                            <td>null</td>
                            <td>height attribute of the image element.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Events</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>onShow</td>
                            <td>-</td>
                            <td>Triggered when the preview overlay is shown.</td>
                        </tr>
                        <tr>
                            <td>onHide</td>
                            <td>-</td>
                            <td>Triggered when the preview overlay is hidden.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Templates</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>indicator</td>
                            <td>-</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>p-image</td>
                            <td>Container element.</td>
                        </tr>
                        <tr>
                            <td>p-image-preview-container</td>
                            <td>Container element with preview enabled.</td>
                        </tr>
                        <tr>
                            <td>p-image-preview-indicator</td>
                            <td>Mask layer over the image when hovered.</td>
                        </tr>
                        <tr>
                            <td>p-image-preview-icon</td>
                            <td>Icon of the preview indicator.</td>
                        </tr>
                        <tr>
                            <td>p-image-mask</td>
                            <td>Preview overlay container.</td>
                        </tr>
                        <tr>
                            <td>p-image-toolbar</td>
                            <td>Transformation options container.</td>
                        </tr>
                        <tr>
                            <td>p-image-action</td>
                            <td>An element inside the toolbar.</td>
                        </tr>
                        <tr>
                            <td>p-image-preview</td>
                            <td>Image element inside the preview overlay.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Dependencies</h5>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <ng-template pTemplate="content">
                <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/image" class="btn-viewsource" target="_blank">
                    <span>View on GitHub</span>
                </a>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;p-image src="assets/showcase/images/galleria/galleria1.jpg" alt="Image" width="250"&gt;&lt;/p-image&gt;

&lt;h5&gt;Preview&lt;/h5&gt;
&lt;p-image src="assets/showcase/images/galleria/galleria11.jpg" alt="Image" width="250" [preview]="true"&gt;&lt;/p-image&gt;
</app-code>
            </ng-template>
        </p-tabPanel>
     </p-tabView>
</div>
